package wxdb.storage;

import java.util.Iterator;

import wxdb.ui.Global;

public class ReferCheck extends Thread{
	Buffer buf;
	ReferCheck(Buffer buffer) {
		buf = buffer;
    }

    public void run() {
    	while(true){
    		try{
    			Thread.sleep(Global.STORAGE_BUF_CHECK);
    			for (Iterator<String> iter = buf.pageHash.keySet().iterator(); iter.hasNext();) {
    				String key = iter.next();  	  
    				Page vapg = buf.pageHash.get(key);
    				vapg.refDown();
    			}
    		}catch(Exception e){
    			System.out.println(e.getMessage());
    		}
    	}
    }

}
